/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Homework2;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 *
 * @author Jakim
 */
public class Figures extends Frame {

    public Figures(){
        super("Графики");
        this.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }

        });
        this.setSize(300, 325);
        this.setVisible(true);
    }

    @Override
    public void paint(Graphics g) {
        g.setColor(Color.blue);
        g.drawRect(25, 50, 250, 250);
        g.fillRect(25, 50, 250, 250);

        g.setColor(Color.white);
        g.drawRoundRect(38, 63, 224, 224, 20, 20);
        g.fillRoundRect(38, 63, 224, 224, 20, 20);

        g.setColor(Color.red);
        g.drawRect(55, 75, 95, 95);
        g.fillRect(55, 75, 95, 95);

        g.setColor(Color.blue);
        g.drawOval(55, 75, 190, 190);
        g.fillOval(55, 75, 190, 190);
        
        g.setColor(Color.white);
        g.drawArc(55, 75, 190, 190, 90, 90);
        g.fillArc(55, 75, 190, 190, 90, 90);
    }

    public static void main(String args[]){
        new Figures();
    }
}
